/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

API.button = API.button || {};

API.button.BasicButton = function(config){
    
    API.apply(this, config, {
        class: 'button',
        listeners: {
            click: function(){}
        }
    });
    
    if(config.class)
        this.class = 'button ' + config.class;
    
    var b = document.createElement('button');
    b.textContent = this.text;
    b.onclick   = this.listeners.click;
    b.className = this.class;
    
    this.DOM = b;
    
};

API.apply(API.button.BasicButton.prototype,{    
    
    setText : function(text){
        this.DOM.innerHTML = text;
    },
    
    disable : function(){
        this.DOM.disabled=true;
    },
    
    enable : function(){
        this.DOM.disabled=false;
    }
});
